package Chapter9;
import java.awt.*;
import java.awt.event.*;
public class Example02 {
	public static void main(String[] args){
		Frame f=new Frame("my window!");
		f.setSize(400,300);
		f.setLocation(300, 200);
		f.setVisible(true);
		MyWindowListener mw=new MyWindowListener();
		f.addWindowListener(mw);
	}
	
}
class MyWindowListener implements WindowListener{
	public void windowClosing(WindowEvent e) {
		Window window=e.getWindow();
		window.setVisible(false);
		window.dispose();
	}
	public void WindowActivated(WindowEvent e) {
		
	}
	public void WindowClosed(WindowEvent e) {
		
	}
	public void WindowDeactivated(WindowEvent e) {
		
	}
	public void WindowDeiconified(WindowEvent e) {
		
	}
	public void WindowIconified(WindowEvent e) {
		
	}
	public void WindowOpened(WindowEvent e) {
		
	}
}
